<!DOCTYPE html>
<html>
	<!--
	  @author 胡昊
	  @email 1120023921@qq.com
	  @Description: 国际贫困率
	-->
	<head lang="zh-CN">
		<title>国际贫困率
		</title>

		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

		<meta charset="utf-8">

		<!-- 引入Jquery -->
		<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>

		<!-- 引入Bootstrap -->
		<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
		<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

		<!-- 引入BootStrap-table -->
		<link rel="stylesheet" href="../assets/libs/bootstrap-table-master/dist/bootstrap-table.min.css">
		<script src="../assets/libs/bootstrap-table-master/dist/bootstrap-table.min.js"></script>

		<!-- 引入Bootstrap-paginator -->
		<script src="../assets/libs/bootstrap-paginator-master/build/bootstrap-paginator.min.js"></script>

		<!-- 引入Echarts -->
		<script src="../assets/libs/echarts/echarts.min.js"></script>
	</head>

	<body>
		<div class="container">
			<div>
				<ul class="nav nav-tabs">
				    <li role="presentation" id="tableTag"><a href="javascript:;" onclick="showTable()">&nbsp;<span class="glyphicon glyphicon-th-large"></span>&nbsp;</a></li>
				    <li role="presentation" id="imageTag"><a href="javascript:;" onclick="showImage()">&nbsp;<span class="glyphicon glyphicon-tasks"></span>&nbsp;</a></li>
				</ul>
			</div>

			<div id="tableView">
				<div class="page-header" style="text-align: center;">
					<h3>国际贫困率</h3>
					<br>
					<h4 style="margin-top: -20px;">International Poverty Ratio</h4>
				</div>
				<table class="table table-hover table-striped" style="text-align: center">
					<tr>
						<td style="text-align: center;">国家</td>
						<td>年份</td>
						<td>日均收入不足1.9的贫困人口占人口比重(单位：%)</td>
						<td>日均收入不足3.1美元的贫困人口占总人口比重(单位：%)</td>
					</tr>
					<tr>
						<td rowspan="3" style="font-size:1.5em;text-align: center;display: table-cell;vertical-align: inherit;">阿尔巴尼亚</td>
						<td>2012</td>
						<td>6.79</td>
						<td>1.06</td>
					<tr>
						<td>2013</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td>2014</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td rowspan="3" style="font-size:1.5em;text-align: center;display: table-cell;vertical-align: inherit;">爱沙尼亚</td>
						<td>2012</td>
						<td>1.61</td>
						<td>0.99</td>
					<tr>
						<td>2013</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td>2014</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td rowspan="3" style="font-size:1.5em;text-align: center;display: table-cell;vertical-align: inherit;">波黑</td>
						<td>2012</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td>2013</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td>2014</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td rowspan="3" style="font-size:1.5em;text-align: center;display: table-cell;vertical-align: inherit;">保加利亚</td>
						<td>2012</td>
						<td>4.7</td>
						<td>2.03</td>
					<tr>
						<td>2013</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td>2014</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td rowspan="3" style="font-size:1.5em;text-align: center;display: table-cell;vertical-align: inherit;">波兰</td>
						<td>2012</td>
						<td>0.26</td>
						<td>0.02</td>
					<tr>
						<td>2013</td>
						<td>0.26</td>
						<td>0.01</td>
					<tr>
						<td>2014</td>
						<td>0.31</td>
						<td>0.01</td>
					<tr>
						<td rowspan="3" style="font-size:1.5em;text-align: center;display: table-cell;vertical-align: inherit;">黑山</td>
						<td>2012</td>
						<td>2.14</td>
						<td>1.26</td>
					<tr>
						<td>2013</td>
						<td>2.53</td>
						<td>1.04</td>
					<tr>
						<td>2014</td>
						<td>0.5</td>
						<td>-</td>
					<tr>
						<td rowspan="3" style="font-size:1.5em;text-align: center;display: table-cell;vertical-align: inherit;">捷克</td>
						<td>2012</td>
						<td>0.3</td>
						<td>0.06</td>
					<tr>
						<td>2013</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td>2014</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td rowspan="3" style="font-size:1.5em;text-align: center;display: table-cell;vertical-align: inherit;">克罗地亚</td>
						<td>2012</td>
						<td>2.24</td>
						<td>0.92</td>
					<tr>
						<td>2013</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td>2014</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td rowspan="3" style="font-size:1.5em;text-align: center;display: table-cell;vertical-align: inherit;">罗马尼亚</td>
						<td>2012</td>
						<td>11.6</td>
						<td>0.11</td>
					<tr>
						<td>2013</td>
						<td>4.05</td>
						<td>-</td>
					<tr>
						<td>2014</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td rowspan="3" style="font-size:1.5em;text-align: center;display: table-cell;vertical-align: inherit;">立陶宛</td>
						<td>2012</td>
						<td>2.03</td>
						<td>1.03</td>
					<tr>
						<td>2013</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td>2014</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td rowspan="3" style="font-size:1.5em;text-align: center;display: table-cell;vertical-align: inherit;">拉脱维亚</td>
						<td>2012</td>
						<td>2.59</td>
						<td>1.38</td>
					<tr>
						<td>2013</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td>2014</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td rowspan="3" style="font-size:1.5em;text-align: center;display: table-cell;vertical-align: inherit;">马其顿</td>
						<td>2012</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td>2013</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td>2014</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td rowspan="3" style="font-size:1.5em;text-align: center;display: table-cell;vertical-align: inherit;">塞尔维亚</td>
						<td>2012</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td>2013</td>
						<td>1.33</td>
						<td>0.19</td>
					<tr>
						<td>2014</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td rowspan="3" style="font-size:1.5em;text-align: center;display: table-cell;vertical-align: inherit;">斯洛伐克</td>
						<td>2012</td>
						<td>0.42</td>
						<td>0.24</td>
					<tr>
						<td>2013</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td>2014</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td rowspan="3" style="font-size:1.5em;text-align: center;display: table-cell;vertical-align: inherit;">斯洛文尼亚</td>
						<td>2012</td>
						<td>0.05</td>
						<td>0.03</td>
					<tr>
						<td>2013</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td>2014</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td rowspan="3" style="font-size:1.5em;text-align: center;display: table-cell;vertical-align: inherit;">匈牙利</td>
						<td>2012</td>
						<td>0.52</td>
						<td>0.26</td>
					<tr>
						<td>2013</td>
						<td>-</td>
						<td>-</td>
					<tr>
						<td>2014</td>
						<td>-</td>
						<td>-</td>
					</tr>
				</table>
			</div>

			<div id="imageView">
				<div class="page-header" style="text-align: center;">
					<h3>国际贫困率柱状图</h3>
					<br>
					<h4 style="margin-top: -20px;">International Poverty Ratio</h4>
				</div>
				
				<div class="panel" style="margin-top: 1.5em;">
					<!--<div style="text-align: right;">单位:&nbsp;%</div>-->
					<div id="main" style="width: 100%;height:400px;"></div>
				</div>
			</div>

			<div style="color: #959595; margin-top: 1.5em;">*此数据仅展现最近五年，若需全部数据请点击&nbsp;<a href="#" class="btn btn-info btn-xs">
				<span class="glyphicon glyphicon-save"></span> 下载
			</a></div>
			<!-- <div style="text-align: right;"><div id="page"></div></div> -->
		</div>
	</body>
	<script>
		$(function() {
			$('#all').hide()
			$('#imageView').hide();
			$('#imageView2').hide();
			$('#tableTag').attr('class', 'active');
		})

		function showTable() {
			$('#all').hide()
			$('#tableView').show();
			$('#tableView2').show();
			$('#imageView').hide();
			$('#imageView2').hide()
			$('#tableTag').attr('class', 'active');
			$('#imageTag').removeClass('active');
			$('#first').show()
			$('#second').show()
		}

		function showImage() {
			$('#all').show()
			$('#imageView').show();
			$('#tableView').hide();
			$('#tableView2').hide();
			$('#imageView2').show();
			$('#imageTag').attr('class', 'active');
			$('#tableTag').removeClass('active');
			$('#first').hide()
			$('#second').hide()
		}

		$('#tableData').bootstrapTable({
			striped: true,
			columns: [{
					field: 'country',
					title: '国家或地区'
				},
				{
					field: 'year2',
					title: '2005年'
				},
				{
					field: 'year3',
					title: '2010年'
				},
				{
					field: 'year4',
					title: '2013年'
				},
				{
					field: 'year5',
					title: '2014年'
				},
				{
					field: 'year6',
					title: '2015年'
				},
			],
			data: [{
					country: '阿尔巴尼亚',
					year2: '0',
					year3: '0',
					year4: '0',
					year5: '0',
					year6: '0',
				},
				{
					country: '爱沙尼亚',
					year2: '0',
					year3: '0',
					year4: '0',
					year5: '0',
					year6: '0',
				},
				{
					country: '保加利亚',
					year2: '2.62',
					year3: '0.75',
					year4: '0',
					year5: '0',
					year6: '0',
				},
				{
					country: '波兰',
					year2: '8.62',
					year3: '14.48',
					year4: '0',
					year5: '0',
					year6: '11.08',
				},
				{
					country: '黑山',
					year2: '0',
					year3: '1.07',
					year4: '0',
					year5: '0',
					year6: '0',
				}, {
					country: '捷克',
					year2: '25.25',
					year3: '10.66',
					year4: '0',
					year5: '0',
					year6: '0',
				}, {
					country: '克罗地亚',
					year2: '1.66',
					year3: '1.75',
					year4: '0',
					year5: '0',
					year6: '0',
				}, {
					country: '拉脱维亚',
					year2: '0',
					year3: '0',
					year4: '0',
					year5: '0',
					year6: '0',
				}, {
					country: '立陶宛',
					year2: '0',
					year3: '0',
					year4: '0',
					year5: '0',
					year6: '0',
				}, {
					country: '罗马尼亚',
					year2: '1.42',
					year3: '0.99',
					year4: '0',
					year5: '0',
					year6: '0',
				}, {
					country: '马其顿',
					year2: '1.55',
					year3: '0.38',
					year4: '0',
					year5: '0',
					year6: '0',
				}, {
					country: '塞尔维亚',
					year2: '2.58',
					year3: '0.79',
					year4: '0',
					year5: '0',
					year6: '0',
				}, {
					country: '斯洛伐克',
					year2: '2.58',
					year3: '0.79',
					year4: '0',
					year5: '0',
					year6: '0',
				}, {
					country: '斯洛文尼亚',
					year2: '1.30',
					year3: '1.00',
					year4: '0',
					year5: '0',
					year6: '0.85',
				}, {
					country: '匈牙利',
					year2: '19.69',
					year3: '20.34',
					year4: '0',
					year5: '0',
					year6: '6.16',
				},

			]
		});
		var all = {
			"data": [
				//05 交易额
				[6.79,1.61,0,4.7,0.26,2.14,0.3,2.24,11.6,2.03,2.59,0,0,0.42,0.05,0.52],
				//5 周转
				[1.06,0.99,0,2.03,0.02,1.26,0.06,0.92,0.11,1.03,1.38,0,0,0.24,0.03,0.26],
				//10 交易额
				[0,0,0,0,0.26,2.53,0,0,4.05,0,0,0,1.33,0,0,0],
				//10 周转
				[0,0,0,0,0.01,1.04,0,0,0,0,0,0,0.19,0,0,0],
				//13
				[0,0,0,0,0.31,0.5,0,0,0,0,0,0,0,0,0,0],
				//13
				[0,0,0,0,0.01,0,0,0,0,0,0,0,0,0,0,0]
			],
			"countrys": ["阿尔巴尼亚", "爱沙尼亚", "波黑", "保加利亚", "波兰", "黑山", "捷克", "克罗地亚", "罗马尼亚", "立陶宛", "拉脱维亚", "马其顿", "塞尔维亚", "斯洛伐克", "斯洛文尼亚", "匈牙利"],
			"years": ["2012年", "2013年", "2014年"]
		};

		var option = {
			timeline: {
				axisType: 'category',
				autoPlay: true,
				playInterval: 2000,
				data: all.years
			},
			options: [{
					tooltip: {
						trigger: 'axis'
					},
					calculable: true,
					grid: {
						y: 100,
						y2: 100
					},
                	title:{
                    	subtext:'数据来源'
                	},
					legend: {
						data: ['日均收入不足1.9的贫困人口占人口比重', '日均收入不足3.1美元的贫困人口占总人口比重']
					},
					xAxis: [{
						type: 'category',
						axisLabel: {
							interval: 0
						},
						data: all.countrys
					}],
					yAxis: [{
						type: 'value',
						name: '%'
					}],
					//05
					series: [{
						name: '日均收入不足1.9的贫困人口占人口比重',
						type: 'bar',
						data: all.data[0]
					}, {
						name: '日均收入不足3.1美元的贫困人口占总人口比重',
						type: 'bar',
						data: all.data[1]
					}]
				},
				//10
				{
					series: [{
						data: all.data[2]
					}, {
						data: all.data[3]
					}]
				},
				//13
				{
					series: [{
						data: all.data[4]
					}, {
						data: all.data[5]
					}]
				},
				//14
				{
					series: [{
						data: all.data[6]
					}, {
						data: all.data[7]
					}]
				},
				//15
				{
					series: [{
						data: all.data[8]
					}, {
						data: all.data[9]
					}]
				}
			]
		};
		var myChart = echarts.init(document.getElementById('main'));
		// 使用刚指定的配置项和数据显示图表。
		myChart.setOption(option);
	</script>

</html>